package distributions;

import java.io.IOException;

public class ErlangStream extends RandomStream
{
  private double Mean;
  private double StandardDeviation;
  private long k;

  public ErlangStream(double paramDouble1, double paramDouble2)
  {
    this.Mean = paramDouble1;
    this.StandardDeviation = paramDouble2;
    double d = this.Mean / this.StandardDeviation;
    this.k = (long) (d * d);
  }

  public ErlangStream(double paramDouble1, double paramDouble2, int paramInt)
  {
    this.Mean = paramDouble1;
    this.StandardDeviation = paramDouble2;
    double d = this.Mean / this.StandardDeviation;
    this.k = (long)(d * d);
    for (int i = 0; i < paramInt * 1000; i++)
      Uniform();
  }

  public ErlangStream(double paramDouble1, double paramDouble2, int paramInt, long paramLong1, long paramLong2)
  {
    super(paramLong1, paramLong2);
    this.Mean = paramDouble1;
    this.StandardDeviation = paramDouble2;
    double d = this.Mean / this.StandardDeviation;
    this.k = (long)(d * d);
    for (int i = 0; i < paramInt * 1000; i++)
      Uniform();
  }

  public double getNumber()
    throws IOException, ArithmeticException
  {
    double d = 1.0D;
    for (int i = 0; i < this.k; i++)
      d *= Uniform();
    return -(this.Mean / this.k) * Math.log(d);
  }
}

/* Location:           /tmp/dlpjava/dlpjava.jar
 * Qualified Name:     distributions.ErlangStream
 * JD-Core Version:    0.6.0
 */